package com.syl.ippool.poolimpl;

import com.syl.ippool.domain.IpBasePojo;
import com.syl.ippool.ifice.pool.IGraspIpPool;

import java.util.List;

/**
 * list ip池， 顶层抽象类
 */
public abstract class AbsListBaseGraspPool implements IGraspIpPool {

    @Override
    public void add(IpBasePojo ipBasePojo) {
        GraspIpPoolEntity.listIps.add(ipBasePojo);
    }

    @Override
    public void add(List<IpBasePojo> ipBasePojos) {
        GraspIpPoolEntity.listIps.addAll(ipBasePojos);
    }

    @Override
    public IpBasePojo get() {
        return GraspIpPoolEntity.listIps.get(0);
    }

    @Override
    public boolean remove(IpBasePojo ipBasePojo) {
        return GraspIpPoolEntity.listIps.remove(ipBasePojo);
    }
}
